-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rock YuliyaP final version viewing party #48
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great job!
@@ -0,0 +1,131 @@ | |||
# WAVE One | |||
def create_movie(movie_title, genre, rating): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
movie = {} | ||
movie['title'] = movie_title | ||
movie['genre'] = genre | ||
movie['rating'] = rating | ||
|
||
for values in movie.values(): | ||
if values == None: | ||
return None | ||
|
||
return movie |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this works just fine! but we are creating space in memory with a variable movie
that might no even be valid yet! so let's think about checking validation before making variables and running code that MIGHT not be needed
movie = {} | |
movie['title'] = movie_title | |
movie['genre'] = genre | |
movie['rating'] = rating | |
for values in movie.values(): | |
if values == None: | |
return None | |
return movie | |
if movie_title and genre and rating: # does these values "exist"/are they truthy? | |
movie = {"title": movie_title, "genre": genre, "rating": rating} | |
return movie | |
else: | |
return None |
return movie | ||
|
||
|
||
def add_to_watched(user_data, movie): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
return user_data | ||
|
||
|
||
def add_to_watchlist(user_data, movie): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
return user_data | ||
|
||
|
||
def watch_movie(user_data, title): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
return (unique_watched) | ||
|
||
|
||
def get_friends_unique_watched(user_data): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
# Wave Four | ||
|
||
|
||
def get_available_recs(user_data): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
|
||
|
||
def get_available_recs(user_data): | ||
friends_unique_movies = get_friends_unique_watched(user_data) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great job reusing a function you've already defined
|
||
# Wave Five (version3) | ||
|
||
def get_new_rec_by_genre(user_data): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
|
||
return recommended_movies | ||
|
||
def get_rec_from_favorites(user_data): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
No description provided.